{% extends 'layout.html' %}}

{% block main %}
    <ol class="breadcrumb">
        <li><a href="/admin">管理首页</a></li>
        <li><span>内容编辑</span></li>
    </ol>
    <h3>内容编辑</h3>
    <form method="post">
        <div class="form-group">
            <label>选择分类</label>
            <select name="category" class="form-control">
                {%for category in categorys%}
                    {% if category.id == info.category.id %}
                    <option value="{{category.id}}" selected="selected">{{category.name}}</option>
                    {% else %}
                    <option value="{{category.id}}">{{category.name}}</option>
                    {% endif %}
                {%endfor%}
            </select>
        </div>
        <div class="form-group">
            <label for="title">标题</label>
            <input value="{{info.title}}" type="text" class="form-control" id="title" name="title" placeholder="请输入标题">
        </div>
        <div class="form-group">
            <label for="description">描述</label>
            <textarea class="form-control" id="description" rows="3" name="description" placeholder="请输入描述">{{info.description}}</textarea>
        </div>
        <div class="form-group">
            <label for="content">内容</label>
            <textarea class="form-control" id="content" rows="5" name="content" placeholder="请输入内容">{{info.content}}</textarea>
        </div>
        <button type="submit" class="btn btn-default">确认修改</button>
</form>
{% endblock %}